#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Time    : 2022/10/22 21:39
# @Author  : when
# @File    : boss_job.py
# @Description :


from sqlalchemy.orm import relationship
from sqlalchemy import Column, Integer, String, TEXT

from crawler.orm_model.base_model import Base
from crawler.orm_model.base_model import BaseModel


class BossJob(Base, BaseModel):
    __tablename__ = 'boss_job'

    id = Column(Integer, primary_key=True, autoincrement=True)
    # 数据唯一标识，md5(name+company_name+salary+experience+degree+skill_tag+招聘人)
    flag = Column(String(255))
    name = Column(String(255))
    company_name = Column(String(255))
    # 公司tag: 行业|融资情况|规模
    company_tag = Column(String(255))
    company_area = Column(String(255))
    salary = Column(String(255))
    # 工作经验
    experience = Column(String(255))
    # 学历
    degree = Column(String(255))
    # 技能tag: xx|xx
    skill_tag = Column(String(255))
    # 工作详情介绍
    details = Column(TEXT)
    # boss活跃时间
    boss_active_time = Column(String(255))
    # boss职位
    boss_post = Column(String(255))
    # 数据是否有效
    is_validity = Column(String(10), default="t")

    # 关联外键(back_populates反查名称)
    page_boss_job = relationship("PageBossJob", back_populates='boss_job')
